import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '../components/Login'
import Index from '../components/Index'
import Database from '../components/index/Database'
import UserManage from '../components/index/UserManage'
import MovieManage from '../components/index/MovieManage'
import CinemaManage from '../components/index/CinemaManage'
import HallManage from '../components/index/HallManage'
import MovieSchedule from '../components/index/MovieSchedule'
import CommentManage from '../components/index/CommentManage'
import OrderManage from '../components/index/OrderManage'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {
    path: '/login',
    name: '登录页面',
    component:Login
  },
  {
    path: '/index',
    name: '管理页面',
    component:Index,
    children:[
      {
        path: '/index',
        redirect: '/index/database'
      },
      {
        path: 'database',
        name: '数据展示页面',
        component: Database
      },
      {
        path: 'user_manage',
        name: '用户管理页面',
        component: UserManage
      },
      {
        path: 'Movie_manage',
        name: '电影管理页面',
        component: MovieManage
      },
      {
        path: 'cinema_manage',
        name: '影院管理页面',
        component: CinemaManage
      },
      {
        path: 'hall_manage',
        name: '影厅管理页面',
        component: HallManage
      },
      {
        path: 'movie_schedule',
        name: '电影排片页面',
        component: MovieSchedule
      },
      {
        path: 'comment_manage',
        name: '评论管理页面',
        component: CommentManage
      },
      {
        path: 'order_manage',
        name: '订单管理页面',
        component: OrderManage
      },
    ]
  }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
